﻿<%@ Page Language="C#" MasterPageFile="~/MainPage.master" AutoEventWireup="true"
    CodeFile="Employees.aspx.cs" Inherits="Employees" Title="Employees" %>

<asp:Content ID="webEmployeesTitle" ContentPlaceHolderID="cphTitle" runat="server">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">
                Employees
            </h1>
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="Home.aspx">Home</a> </li>
                <li class="active"><i class="fa fa-file"></i>Employees </li>
            </ol>
        </div>
    </div>
</asp:Content>
<asp:Content ID="webOrders" ContentPlaceHolderID="cphMainPage" runat="Server">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Employee Manager</title>
        <link href="css/CSSGridView1.css" rel="stylesheet" type="text/css" />
        <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>

        <script src="Scripts/jquery.dynDateTime.min.js" type="text/javascript"></script>

        <script src="Scripts/calendar-en.min.js" type="text/javascript"></script>

        <link href="Styles/calendar-blue.css" rel="stylesheet" type="text/css" />


       <script type="text/javascript">
    $(document).ready(function () {
        $("#<%=txtDateOfBirth.ClientID %>").dynDateTime({
            showsTime: false,
            ifFormat: "%m/%d/%Y",
            daFormat: "%l;%M %p, %e %m,  %Y",
            align: "BR",
            electric: false,
            singleClick: false,
            displayArea: ".siblings('.dtcDisplayArea')",
        });
    });
        </script>
        
        <script type="text/javascript">
    $(document).ready(function () {
        $("#<%=txtDateOfHire.ClientID %>").dynDateTime({
            showsTime: false,
            ifFormat: "%m/%d/%Y",
            daFormat: "%l;%M %p, %e %m,  %Y",
            align: "BR",
            electric: false,
            singleClick: false,
            displayArea: ".siblings('.dtcDisplayArea')",
            button: ".next()"
        });
    });
        </script>

    </head>
    <body>
        <form id="form1">
        <div>
            <table>
                <tr>
                    <td>
                        <table cellspacing="0">
                            <tr>
                                <td style="width: 400px">
                                    <table cellpadding="1" cellspacing="1" width="100%">
                                        <tr style="height: 30px">
                                            <td>
                                                ID:
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtID" name="txtID" Width="53" runat="server" ReadOnly="True"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                Title of Courtesy:
                                            </td>
                                            <td align="left">
                                                <asp:DropDownList ID="DDLToC" runat="server">
                                                    <asp:ListItem>&nbsp;</asp:ListItem>
                                                    <asp:ListItem>Ms.</asp:ListItem>
                                                    <asp:ListItem>Mr.</asp:ListItem>
                                                    <asp:ListItem>Mrs.</asp:ListItem>
                                                    <asp:ListItem>Dr.</asp:ListItem>
                                                </asp:DropDownList>
                                                <asp:RequiredFieldValidator ID="rfvDDLToC" runat="server" ErrorMessage="Required Choose"
                                                    ControlToValidate="DDLToC" Display="Dynamic"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                Lastname:
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtLastname" name="txtLastname" runat="server" MaxLength="20" AutoCompleteType="LastName"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="rfvLastname" runat="server" ErrorMessage="Required Fill"
                                                    ControlToValidate="txtLastname" Display="Dynamic"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                Firstname:
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtFirstname" name="txtFirstname" runat="server" MaxLength="10"
                                                    AutoCompleteType="FirstName"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                                    ControlToValidate="txtLastname" ErrorMessage="Required Fill"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                Title:
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtTitle" name="txtTitle" runat="server" MaxLength="30" AutoCompleteType="JobTitle"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="rfvTitle" runat="server" ErrorMessage="Required Fill"
                                                    ControlToValidate="DDLToC" Display="Dynamic"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                DateOfBirth
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtDateOfBirth" NAME="txtDateOfBirth" runat="server" 
                                                    Width="147px"></asp:TextBox>
                                                <asp:Label ID="lbdate" runat="server"></asp:Label>
                                            <td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                DateOfHire
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtDateOfHire" NAME="txtDateOfHire" runat="server" 
                                                    Width="147px"></asp:TextBox>
                                               
                                            </td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                mgrID:
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="DDLMgrID" runat="server" Visible="False">
                                                </asp:DropDownList>
                                                <asp:Button ID="btnMgrID" runat="server" CausesValidation="False" Height="20px" 
                                                    onclick="btnMgrID_Click" Text="..." Width="31px" />
                                                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                                    ControlToCompare="DDLMgrID" ControlToValidate="txtID" Display="Dynamic" 
                                                    ErrorMessage="Can't manage themselves" Operator="NotEqual"></asp:CompareValidator>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td>
                                    <table cellpadding="1" cellspacing="1">
                                        <tr style="height: 90px">
                                            <td align="left">
                                                Address:
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtAddress" name="txtAddress" runat="server" TextMode="MultiLine"
                                                    Height="90px" Width="178" MaxLength="60" AutoCompleteType="HomeStreetAddress"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="rfvAddress" runat="server" ErrorMessage="Required Fill"
                                                    ControlToValidate="txtAddress" Display="Dynamic"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                Country:
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="DDLCountry" runat="server" Width="178px" 
                                                    DataSourceID="xmlCountries" DataTextField="name" DataValueField="name">
                                                    
                                                </asp:DropDownList>
                                                <asp:XmlDataSource ID="xmlCountries" runat="server" 
                                                    DataFile="~/App_Data/countries.xml"></asp:XmlDataSource>
                                                <asp:RequiredFieldValidator ID="rfvDDLCountry" runat="server" ErrorMessage="Required Choose"
                                                    ControlToValidate="DDLCountry" Display="Dynamic"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                City:
                                                <td>
                                                    <asp:TextBox ID="txtCity" name="txtCity" runat="server" MaxLength="15" AutoCompleteType="HomeCity"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="rfvCity" runat="server" ErrorMessage="Required Fill"
                                                        ControlToValidate="txtCity" Display="Dynamic"></asp:RequiredFieldValidator>
                                                </td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                Region:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtRegion" name="txtRegion" runat="server" MaxLength="15" AutoCompleteType="HomeCountryRegion"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                PostPostalCode:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtPostcode" name="txtPostcode" runat="server" MaxLength="5" AutoCompleteType="HomeZipCode"></asp:TextBox>
                                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                                    ControlToValidate="txtPostcode" Display="Dynamic" 
                                                    ErrorMessage="Required 5 digits" ValidationExpression="\d{5}?"></asp:RegularExpressionValidator>
                                            </td>
                                        </tr>
                                        <tr style="height: 30px">
                                            <td>
                                                Phone:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtPhone" name="txtPhone" runat="server" MaxLength="24" AutoCompleteType="HomePhone"> </asp:TextBox>
                                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtPhone"
                                                    ErrorMessage="(999) 000-0000" 
                                                    ValidationExpression="((\(\d{1}?\d{1}?\d{1}\) )?)\d{3}-\d{4}"></asp:RegularExpressionValidator>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <table cellspacing="1">
                            <tr>
                                <td>
                                    <asp:Button ID="btnNew" name="btnNew" runat="server" Text="New" Width="80" OnClick="btnNew_Click"
                                        CausesValidation="False" />
                                    <asp:Button ID="btnAdd" name="btnAdd" runat="server" Text="Add" Width="80" OnClick="btnAdd_Click" />
                                    <asp:Button ID="btnUpdate" name="btnUpdate" runat="server" Text="Update" Width="80"
                                        OnClick="btnUpdate_Click" Enabled="False" />
                                    <asp:Button ID="btnSearch" name="btnAdd" runat="server" Text="Search by" Width="80"
                                        OnClick="btnSearch_Click" CausesValidation="False" />
                                    <asp:DropDownList ID="DDLSearchMethod" runat="server" Width="82">
                                        <asp:ListItem>ID</asp:ListItem>
                                        <asp:ListItem>mgrID</asp:ListItem>
                                        <asp:ListItem>name</asp:ListItem>
                                        <asp:ListItem>title</asp:ListItem>
                                        <asp:ListItem>country</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:TextBox ID="txtSearch" name="txtSearch" Width="178px" runat="server" 
                                        ontextchanged="txtSearch_TextChanged"></asp:TextBox>
                                    <asp:Label ID="lbError" runat="server" ForeColor="Red"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td>
                        <asp:GridView ID="gvEmployees" runat="server"
                            OnPageIndexChanging="gvEmployees_PageIndexChanging" AutoGenerateColumns="False"
                            CssClass="Grid" AlternatingRowStyle-CssClass="alt" 
                            PagerStyle-CssClass="pgr" AllowSorting="True" 
                            onsorting="gvEmployees_Sorting" SelectedRowStyle-VerticalAlign="NotSet" 
                            onselectedindexchanged="gvEmployees_SelectedIndexChanged">
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </div>
        </form>
    </body>
    </html>
</asp:Content>
